﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace LitTools
{
    /// <summary>
    /// 行为节点-等待
    /// </summary>
    public class BTNode_Action_Await : BTNode_Action
    {
        private readonly float delyTime;
        private float curTime;

        public BTNode_Action_Await(string name, float delyTime)
        {
            this.name = name;
            this.delyTime = delyTime;
        }

        protected override void OnStart()
        {
            curTime = 0;
        }

        protected override void OnStop()
        {

        }

        protected override BTNodeState OnUpdate()
        {
            curTime += Time.deltaTime;
            if (curTime < delyTime)
                return BTNodeState.Running;
            return BTNodeState.Success;

        }
    }
}